package com.hzw.saas.web.app.rss.param;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.util.List;

@Data
public class LibraryParam {
    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "文章标识")
    private String doi;

//    @NotNull(message = "文章发布日期不能为空")
    @DateTimeFormat(pattern = DatePattern.NORM_DATE_PATTERN)
    @JsonFormat(pattern = DatePattern.NORM_DATE_PATTERN)
    @ApiModelProperty(value = "文章发布日期")
    private Date pubDate;

    @ApiModelProperty(value = "文章描述")
    private String description;

//    @NotNull(message = "作者不能为空")
    @ApiModelProperty(value = "作者们")
    private List<String> authors;

    @ApiModelProperty(value = "期刊名")
    private String journalName;

//    @Pattern(regexp = "^[\\w\\d]([\\w\\d]*\\.){1,6}.*", message = "请输入正确的下载地址")
    @NotBlank(message = "资源ID不能为空")
    @ApiModelProperty(value = "资源ID")
    private String downloadUrl;

    @NotBlank(message = "资源文件名不能为空")
    @ApiModelProperty(value = "资源文件名")
    private String resourceFileName;

    @ApiModelProperty(value = "资源文件MD5")
    private String resourceMd5;

    @NotBlank(message = "分类不能为空")
    @ApiModelProperty(value = "分类ID")
    private String libraryCatalogId;

}
